<template>
  <div>
    <svg-icon icon-class="fullscreen" class-name="fullScreen" @click="onscreenFull" />
  </div>
</template>

<script>
// 全屏插件
import screenfull from 'screenfull'

export default {
  name: 'FullScreen',
  methods: {
    onscreenFull() {
      if (screenfull.isEnabled) {
        screenfull.request()
      } else {
        return this.$message.warning('亲，浏览器不支持全屏')
      }
      screenfull.toggle()
    }
  }
}
</script>

<style scoped lang='scss'>
.fullScreen{
    width: 36px;
    height: 21px;
  color: #fff;
  // padding: 0 10px;
  cursor: pointer;
}
</style>
